package cjq.demo.spring.aop;

/**
 * author: cjianquan
 * date: 2016/9/9
 */
public class GreetingProxy implements Greeting {
    private GreetingImpl greetingImpl;

    public GreetingProxy(GreetingImpl greetingImpl) {
        this.greetingImpl = greetingImpl;
    }

    @Override
    public void sayHello(String name) {
        before();
        greetingImpl.sayHello(name);
        after();
    }

    private void before() {
        System.out.println("Static Proxy Before");
    }

    private void after() {
        System.out.println("Static Proxy After");
    }
}
